#include "QLineEditEx.h"
#include <QtGui\QKeyEvent>

QLineEditEx::QLineEditEx(void) : QLineEdit()
{

}

QLineEditEx::~QLineEditEx(void)
{
}

void QLineEditEx::keyPressEvent( QKeyEvent* event2 )
{
	Qt::Key test = (Qt::Key) event2->key();
	QString string(test);
	//QString strKeyPad("");

	//if(event2->modifiers() == Qt::KeypadModifier)
	//{
	//	strKeyPad = "KP";
	//}

	switch(test)
	{
	case Qt::Key_Shift:			this->setText("Shift"); break;
	case Qt::Key_Control:		this->setText("Ctrl"); break;
	case Qt::Key_Escape:		this->setText("ESC"); break;
	case Qt::Key_Alt:			this->setText("ALT"); break;
	case Qt::Key_Tab:			this->setText("Tab"); break;
	case Qt::Key_Return:		this->setText("Return"); break;
	case Qt::Key_Up:			this->setText("Up"); break;
	case Qt::Key_Down:			this->setText("Down"); break;
	case Qt::Key_Left:			this->setText("Left"); break;
	case Qt::Key_Right:			this->setText("Right"); break;
	case Qt::Key_Backspace: 	this->setText("Backspace"); break;
	case Qt::Key_Space:	 	this->setText("Space"); break;
	//case Qt::Key_Space:	 		this->setText("Space"); break;
	//case Qt::Key_Space:	 		this->setText("Space"); break;
	//case Qt::Key_Space:	 		this->setText("Space"); break;
	//case Qt::Key_Space:	 		this->setText("Space"); break;
	//case Qt::Key_Space:	 		this->setText("Space"); break;
	//case Qt::Key_Space:	 		this->setText("Space"); break;
	//case Qt::Key_Space:	 		this->setText("Space"); break;
	//case Qt::Key_Space:	 		this->setText("Space"); break;
	//case Qt::Key_Space:	 		this->setText("Space"); break;
	//case Qt::Key_Space:	 		this->setText("Space"); break;

	default: this->setText(event2->text()); // normal signs do not need to be switched
	}
}
